﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QuanLyBanHang.DAL;

namespace QuanLyBanHang.Report
{
    public partial class frmBaoCao : Form
    {
        public frmBaoCao()
        {
            InitializeComponent();
        }

        public DateTime start, end;

        private void frmBaoCao_Load(object sender, EventArgs e)
        {
            start = DateTime.Parse("06/10/2014");
            end = DateTime.Parse("06/12/2014");
            DataTable dt = DalTimKiem.spHangDaBan(start, end);
            reportViewer1.LocalReport.DataSources.Clear();
            reportViewer1.LocalReport.ReportEmbeddedResource = "QuanLyBanHang.Report.rpHangDaBan.rdlc";
            Microsoft.Reporting.WinForms.ReportDataSource dataset = new Microsoft.Reporting.WinForms.ReportDataSource("spHangDaBan", dt);
            // nếu có nhiều dataset thì cứ tạo thêm và truyền vào như thế
            reportViewer1.LocalReport.DataSources.Add(dataset);

            this.reportViewer1.RefreshReport();
        }
    }
}
